package com.twu.biblioteca;

public class Book {
    private int id;
    private String name;
    private int status;
    public static int TAKEN = 1;
    public static int AVAILABLE = 2;

    public Book(int id, String name) {
        this.id = id;
        this.name = name;
        this.status = Book.AVAILABLE;
    }

    public Book(int id, String name, int status) {
        this.id = id;
        this.name = name;
        this.status = status;
    }

    public String getName() {
        return name;
    }

    public int getId() {
        return id;
    }

    public boolean isAvailable() {
        return status == AVAILABLE;
    }

    public void take() {
        status = TAKEN;
    }

    @Override
    public String toString() {
        return id +
                ": " + name;
    }
}
